package com.design.pattern.builder.director;

import com.design.pattern.builder.IMsgBuilder;
import com.design.pattern.builder.product.AutoMessage;

/**
 * Created by Administrator on 2016/5/18.
 */
public class Director {

    private IMsgBuilder builder;

    public Director(IMsgBuilder builder) {
        this.builder = builder;
    }

    public void construct(String from,String to){
        this.builder.setFrom(from);
        this.builder.setTo(to);
        this.builder.setSuject();
        this.builder.setDate();
        AutoMessage message = this.builder.build();
        message.send();
    }
}
